package io.netty.example.http.websocketx.server;

import io.netty.channel.Channel;
import io.netty.channel.ChannelId;
import io.netty.channel.group.ChannelMatcher;

/**
 * @author fuguangli
 * @description 前沿类
 * @Create date:    2017/4/27
 */
public class CusChannelMatcher implements ChannelMatcher {
    private ChannelId channelId;


    public void setChannel(ChannelId channelId) {
        this.channelId = channelId;
    }

    public CusChannelMatcher() {
    }

    public CusChannelMatcher(ChannelId channelId) {
        this.channelId = channelId;
    }

    public boolean matches(Channel channel) {
        if (channel.id().equals(this.channelId)) {
            return true;
        }

        return false;
    }
}
